﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace HighFantasy
{

     
    public class Panel
    {

        private Texture2D panelarea, buttonleft, buttonright;
        private SpriteFont font;
        private ContentManager content;
        public Rectangle area, left, right;
        public Vector2 pos;
        public String panelselection;
        public int selectionid;
        public bool isVisible;
        public PlayerData playerdata;
        public Texture2D playerface;

        public Panel(ContentManager content)
        {
            this.content = content;
            area = new Rectangle(640, 0, 156, 600);
            pos = new Vector2(640, 0);
            panelarea = content.Load<Texture2D>("Background/Panel");
            font = content.Load<SpriteFont>("Fonts/Panel");
            
        }

        public void Update(GameTime gameTime, Level level)
        {
            if (level.player != null)
                playerdata = level.player.data;
                playerface = level.player.Face;
        }

        public void Draw(SpriteBatch spriteBatch, float CameraPosX)
        {
            
            spriteBatch.Draw(panelarea, new Vector2(pos.X + CameraPosX, pos.Y), Color.White);
            spriteBatch.Draw(playerface, new Vector2(664 + CameraPosX, 28), Color.White);
            spriteBatch.DrawString(font, playerdata.Profile.Name, new Vector2(732 + CameraPosX, 20), Color.White);
            spriteBatch.DrawString(font, "Lvl= " + playerdata.Profile.Level, new Vector2(732 + CameraPosX, 60), Color.White);
            spriteBatch.DrawString(font, playerdata.Profile.Profession, new Vector2(664 + CameraPosX, 100), Color.White);
        }
    }
}
